<?php TPL::output('mobile/header.tpl.htm'); ?>

<script type="text/javascript">
	var TOPIC_ID = '<?php echo $this->topic_info['topic_id']; ?>';
	
	$(document).ready(function () {
		$('#contents_nav span').click(function () {
			$('#contents_nav span').removeClass('click');
			
			$('div.tpage').hide();
			$('div.tpage._contents' + $(this).attr('class')).show();
			
			if ($('div.tpage._contents' + $(this).attr('class')).find('ul').html() == '')
			{
				switch ($(this).attr('class'))
				{					
					case '_best':
						mobile_more_load(G_BASE_URL + '/topic/ajax/question_list/type-best__template-mobile__topic_id-' + TOPIC_ID, $('#bp_best_question_more'), $('#c_best_question_list'));
					break;
					
					case '_noanswer':
						mobile_more_load(G_BASE_URL + '/question/ajax/discuss/template-mobile__answer_count-0__topic_id-' + TOPIC_ID, $('#bp_noanswer_more'), $('#c_noanswer_list'), 1);
					break;
				}
			}
			
			$(this).addClass('click');
		});
		
		mobile_more_load(G_BASE_URL + '/topic/ajax/question_list/template-mobile__topic_id-' + TOPIC_ID, $('#bp_all_more'), $('#c_all_list'));
	});
</script>

<div class="subject">
	<div style=" text-align:center;">
		<img class="hp" src="<?php echo get_topic_pic_url('max', $this->topic_info['topic_pic']); ?>" />
		<div class="name"><?php echo $this->topic_info['topic_title']; ?><div class="lock"></div></div>
        <?php if ($this->user_id) { ?><span class="sub<?php if ($this->topic_info['has_focus']) { ?> cur <?php } ?>" onclick="focus_topic($(this), $(this), <?php echo $this->topic_info['topic_id']; ?>); return false;"><?php if ($this->topic_info['has_focus']) { ?>取消<?php } ?>关注</span><?php } ?>
        <div class="sign"></div>
    </div>
        
    <div class="nav" id="contents_nav">
    	<span class="click _all">所有问题</span>
    	<span class="_best">最佳评价</span>
    	<span class="_noanswer">等待回复</span>
    </div>
        
    <div class="con">
    	<div class="tpage _contents_all">
        	<ul id="c_all_list"></ul>
        	
            <div class="more" id="bp_all_more">更多</div>
        </div>
        
        <div class="tpage _contents_best" style="display:none">
        	<ul id="c_best_question_list"></ul>
        	
            <div class="more" id="bp_best_question_more">更多</div>
        </div>
        
        <div class="tpage _contents_noanswer" style="display:none"s>
        	<ul id="c_noanswer_list"></ul>
        	
            <div class="more" id="bp_noanswer_more">更多</div>
        </div>
    </div>
</div>

<?php TPL::output('mobile/footer.tpl.htm'); ?>